unit unitDBToolGenerator;

interface
uses System.Generics.Collections, unitADOTool,unitStandardAccessTool,unitStandardSqlTool;

type TDBToolGenerator=class
  public
    function generate(const info:TDictionary<string,string>):TADOTool;
end;

implementation
uses System.SysUtils;

{ TDBToolGenerator }

function TDBToolGenerator.generate(
  const info: TDictionary<string, string>): TADOTool;
begin
  if info['dbtype']='acc' then begin
    Result:=TStandardAccessTool.Create(info);
  end else if info['dbtype']='ace' then begin
    Result:=TStandardAccessTool.Create(info);
  end else if info['dbtype']='sql' then begin
    Result:=TStandardSqlTool.Create(info);
  end else begin
    raise Exception.Create('Unknown database type');
  end;
end;

end.
